package com.homework.feign;

import com.baomidou.mybatisplus.extension.api.R;
import com.homework.search.dto.PostDTO;
import com.homework.service.PostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/hw-blog")
public class HwBlogFiegn {

    @Autowired
    PostService postService;

    @GetMapping("/findPostDTOByPostId")
    public R<PostDTO> findPostDTOByPostId(long postId) {

        PostDTO postDTO = postService.findPostDTOById(postId);

        return R.ok(postDTO);
    }
}
